home *** CD-ROM | disk | FTP | other *** search
/ Aminet 1 (Walnut Creek) / Aminet - June 1993 [Walnut Creek].iso / aminet / dev / lang / sbp3_1e.lzh / NLUSNTAX.PL < prev    next >
Text File  |  1991-10-31  |  1KB  |  44 lines

  1. /* From the book PROLOG PROGRAMMING IN DEPTH
  2.    by Michael A. Covington, Donald Nute, and Andre Vellino.
  3.    Copyright 1988 Scott, Foresman & Co.
  4.    Non-commercial distribution of this file is permitted. */
  5.  
  6. /* NLUSNTAX.PL */
  7.  
  8. /* Syntax for the language that will be parsed
  9.    by NLU.PL  (See NLU.PL for vocabulary.)  */
  10.  
  11.  
  12. /* Rule */                              /* Example */
  13.  
  14. sentence -->
  15.   noun_phrase, verb_phrase.             /* Dogs chase cats. */
  16.  
  17. sentence -->
  18.   noun_phrase, copula, noun_phrase.     /* Dogs are animals. */
  19.  
  20. sentence -->
  21.   noun_phrase, copula, adj_phrase.      /* Dogs are big. */
  22.  
  23. sentence -->
  24.   aux_verb, noun_phrase, verb_phrase.   /* Do dogs chase cats? */
  25.  
  26. sentence -->
  27.   copula, noun_phrase, noun_phrase.     /* Are dogs animals? */
  28.  
  29. sentence -->
  30.   copula, noun_phrase, adj_phrase.      /* Are dogs big? */
  31.  
  32. verb_phrase --> verb, noun_phrase.      /* chase cats */
  33.  
  34. adj_phrase --> adjective.               /* big */
  35.  
  36. noun_phrase -->
  37.   determiner, noun_group.               /* a big brown dog */
  38.  
  39. noun_group --> adjective, noun_group.   /* big brown dog */
  40.  
  41. noun_group --> common_noun.             /* dog */
  42.  
  43. noun_group --> proper_noun.             /* Fido */
  44.